package cn.tianya.irock.exceptions;

import cn.tianya.irock.enums.ApplicationExceptionType;

public class ApplicationException extends CoreException {
	
	protected Exception exception;
	protected String message;
	private ApplicationExceptionType type;
	
	public ApplicationException (ApplicationExceptionType t) {
		this(t, "");
	}
	
	public ApplicationException (ApplicationExceptionType t, String message) {
		this(t, message, null);
	}
	
	public ApplicationException (ApplicationExceptionType t, Exception ref) {
		this(t, "", ref);
	}
	
	public ApplicationException (ApplicationExceptionType t, String message, Exception ref) {
		this.type = t;
		this.message = message;
		this.exception = ref;
	}
	
	//public ApplicationExceptionType getExceptionType() {
	//	return this.type;
	//}

	public int getExceptionValue() {
		return this.type.getValue();
	}
	
	public Exception getRefException() {
		return this.exception;
	}
	
	@Override
	public String getMessage() {
		return message;
	}
	
	
}
